package com.calculate;

/**
 * Created by tjpu on 2016/10/2.
 */
public class AngleFix {
    public static double[] rotation(double[] point, double angle) {
        double [] newPoint = new double[2];

        newPoint[0] = Math.cos(angle) * point[0] - Math.sin(angle) * point[1];
        newPoint[1] = Math.sin(angle) * point[0] + Math.cos(angle) * point[1];
        return newPoint;
    }

    public static double[] rotation(double x, double y, double angle) {
        double [] newPoint = new double[2];

        newPoint[0] = Math.cos(angle) * x - Math.sin(angle) * y;
        newPoint[1] = Math.sin(angle) * x + Math.cos(angle) * y;
        return newPoint;
    }


}
